#ifndef _TASKQUEUE_H
#define _TASKQUEUE_H
#include "MutexLock.h"
#include "condition.h"
#include <queue>
#include <functional>
using std::function;
using Task = function<void()>;
using std::queue;
class TaskQueue
{
public:
    TaskQueue(int);
    void push(Task);
    Task pop();
    bool empty();
    bool full();
    void wakeup();
private:
    queue<Task> _queue;
    int _queSize;
    MutexLock _mutex;
    condition _NotFull;
    condition _NotEmpty;
    bool _flag;
};

#endif
